package edu.hgnc.cglib;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class MyCglib implements MethodInterceptor {

	private static final Log logger = LogFactory.getLog(MyCglib.class);


	@Override
	public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
		logger.debug("目标方法执行之前："+method);
		Object o1 = methodProxy.invokeSuper(o, objects);
		logger.debug("目标方法执行之后："+method);
		return o1;
	}
}
